package com.itheima.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//Rest格式
@Slf4j
@RestController
@RequestMapping("/books")
public class BookController{

    /*创建记录日志的对象*/
    //private static final Logger Log= LoggerFactory.getLogger(BookController.class);
    /*通过继承BaseClass类的方式来进行日志输出*/

    @GetMapping
    public String getById(){
        System.out.println("spring is running");

        log.trace("trace");
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");

        return "spring is running";
    }
}
